<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
	String gd_id = request.getParameter("gd_id") == null ? "" : request.getParameter("gd_id");
%>
<html>
	<head>
		<title>材料预算</title>
		<style>
			.td1{
				padding-top:10px;
				padding-bottom:5px;
				font-size: 12px;
				background-color: #c0ebd7;
				width:36%;
			}
			.td2{
				padding:5px;
				width:64%;
			}
		</style>
		<script type="text/javascript">
			$(function() {
				$.ajax({
					type:"POST",
					url:"<%=contextPath %>/springMVC/gd/getGDControl?gd_id=<%=gd_id%>",
					success:function(rtData){
						$('#control').numberbox('setValue',rtData);
						//$('#control').numberbox('disable',true);
					}
				});
				$('#table').datagrid({
							  	title:'材料预算',
							  	iconCls:'icon-save',
							  	url:'<%=contextPath%>/springMVC/gd/listPageMaterial?gd_id=<%=gd_id%>',
							  	rownumbers:true,
							  	singleSelect:true,
								fitColumns:true,
								nowrap:false,
								frozenColumns:[[
								    {title:'材料id',field:'material_id',hidden:true}
								]],
								columns:[[
									{title:'材料编号',field:'code',width:100,align:'center'},
									{title:'材料名称',field:'name',width:200,align:'center'},
									{title:'规格/型号',field:'format_type',width:200,align:'center'},
									{title:'单位',field:'unit_name',width:50,align:'center'},
									{title:'预算数量',field:'num',width:100,align:'center'},
									{title:'备注',field:'remark',width:260,align:'center'}
								]],
								pageSize:10,
								pageList : [10,50,100],  
								pagination:true
							});
			});
		</script>
	</head>
	<body>
		<table  style="border-collapse: collapse;width:100%" border="1px" bordercolor="#0eb83a" >
			<tr>
				<td align="right"  nowrap class="td1">
					材料管控精度：
				</td>
				<td class="td2" nowrap >
					<input id="control" name="control" class="easyui-numberbox" data-options="precision:2,required:true" /> %
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<div id="table" ></div> 
				</td>
			</tr>
		</table>
	</body>
</html>